https://developer.apple.com/documentation/xcodekit/creating_a_source_editor_extension
I created new MacOS project and added a Xcode Source Editor Extension target to the project.
I run the extension in debug mode with extension target, but the extension is not show up in Editor menu debug mode Xcode.
Xcode version is 15.3(released)
MacOS version is 14.4.1 Sonoma
XcodeKit
RSS for tagCreate extensions to add commands to the Xcode source editor.
Posts under XcodeKit tag
3 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I created a macOS app, added an XPC service target, and also added a source editor extension.
in The source editor extension‘s perform function. It doesn't work
- (void)performCommandWithInvocation:(XCSourceEditorCommandInvocation *)invocation completionHandler:(void (^)(NSError * _Nullable nilOrError))completionHandler {
self.xpcConnect = [[NSXPCConnection alloc] initWithServiceName:@"test.TestNewXPCApp.NewXPC"];
NSXPCInterface *interface = [NSXPCInterface interfaceWithProtocol:@protocol(NewXPCProtocol)];
self.xpcConnect.remoteObjectInterface = interface;
[self.xpcConnect resume];
[[self.xpcConnect remoteObjectProxy] performCalculationWithNumber:@231 andNumber:@119 withReply:^(NSNumber *reply) {
// We have received a response.
NSLog(@"ui success%@", reply);
}];
But In ViewControler.m, executing the same code , it can work.
So why is it possible to connect to the XPC service from within the macOS app, but not from the source editor extension?
I want to
build an Xcode Source Code Editor extension
that triggers an XPC service
shows a gui that can handle user interactions
Is it possible in any way ?
what are the alternatives to display the UI and allow the user to interact on it ?